<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>QAPP-UI</title>
  <link rel="icon" href="./docs/assets/favicon.ico" type="image/png">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="description" content="Description">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
  <link rel="stylesheet" href="./docs/assets/index.css">
</head>
<body>
  <div id="app"></div>
  <script>
    window.$docsify = {
      name: 'QAPP-UI',
      search: 'auto',
      search: {
        maxAge: 86400000, // 过期时间，单位毫秒，默认一天
        placeholder: '搜索'
      },
      themeColor: '#50B3F9',
      coverpage: 'docs/_coverpage.md',
      loadSidebar: 'docs/_sidebar.md',
      auto2top: true,
      alias: {
        '/components/.*/_sidebar.md': 'docs/_sidebar.md',
      },
      basePath: location.port === '3000' ? '/' : '/qapp-ui/',
      repo: 'qapp-ui/qapp-ui',
      plugins: [
        function (hook, vm) {
          hook.beforeEach(function (html) {
            var url = 'https://github.com/qapp-ui/qapp-ui/blob/master/' + vm.route.file;
            var editHtml = '<a href='+ url +' data-tooltip-title=\"Correct this doc\" data-tooltip-position=\"top\" class=\"tool-tip\" target=\"_blank\"><img class=\"emoji\" src=\"./docs/assets/edit.png\" alt=\"Edit\"></a>';
            return "<div class=\"tool-docs-header\">"
              + editHtml + "</div>"
              + '\n\n' + html + '\n----\n'
          })
        },
        function (hook, vm) {
          hook.doneEach(function () {
            var codeBlocks = document.querySelectorAll("pre[v-pre]");
            codeBlocks.forEach((element, i, obj) => {
              var button = document.createElement("button");
              button.appendChild(document.createTextNode("Click to copy"));
              button.classList.add("docsify-copy-code-button");
              if (vm.config.themeColor) {
                button.style.background = vm.config.themeColor;
              }
              button.addEventListener("click", function (event) {
                var range = document.createRange();
                var codeBlock = element.querySelector("code");
                range.selectNode(codeBlock);
                window.getSelection().addRange(range);
                try {
                  // Now that we've selected the anchor text, execute the copy command
                  var successful = document.execCommand("copy");
                  if (successful) {
                    button.classList.add("success");
                    setTimeout(function () {
                      button.classList.remove("success");
                    }, 1000);
                  }
                } catch (err) {
                  button.classList.add("error");
                  setTimeout(function () {
                    button.classList.remove("error");
                  }, 1000);
                }
                var selection = window.getSelection();
                if (typeof selection.removeRange === "function") {
                  selection.removeRange(range);
                } else if (typeof selection.removeAllRanges === "function") {
                  selection.removeAllRanges();
                }
              });
              element.appendChild(button);
            });
          });
        }
      ]
    }
  </script>
  <script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
  <script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>

</body>
</html>
